-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMain.java
33 lines (27 loc) · 1.01 KB
/
Main.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import java.io.IOException;
import java.util.Scanner;
public class Main {
public static void main(String[] args) throws IOException {
Scanner sc = new Scanner(System.in);
double renda, valorSobra, valorTotal;
renda = sc.nextDouble();
if(renda >= 0.0 && renda <= 2000.00){
System.out.println("Isento");
}
else if(renda <= 3000){
valorTotal = (renda - 2000.00) * 0.08;
System.out.printf("R$ %.2f\n", valorTotal);
}
else if(renda <= 4500){
valorSobra = renda - 3000;
valorTotal = ((valorSobra) * 0.18) + ((renda - valorSobra - 2000) * 0.08);
System.out.printf("R$ %.2f\n", valorTotal);
}
else{
valorSobra = renda - 4500;
valorTotal = ((valorSobra) * 0.28) + ((renda - valorSobra - 3000) * 0.18) + ((renda - valorSobra - 3500) * 0.08);
System.out.printf("R$ %.2f\n", valorTotal);
}
sc.close();
}
}